package com.edu.admin.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import com.edu.admin.common.BaseMapper;
import com.edu.admin.entity.SysClasses;
import com.edu.admin.vo.ClassesSubjectVo;
import com.edu.admin.vo.ClassesTeacherVo;
import com.edu.admin.vo.ClassesVo;

/**
 * 班级表数据操作接口
 * 
 * @author Wangjiong
 * 
 */
@Mapper
public interface ClassesMapper extends BaseMapper<SysClasses> {

	
	/**
	 * 获取班级信息
	 * 
	 * @param Long classesId
	 * 
	 * @return ClassesVo
	 */
	ClassesVo getClassesByClassesId(@Param("classesId") Long classesId);
	
	/**
	 * 获取班级信息
	 * 
	 * @param schoolId
	 * @param phaseId
	 * @param gradeId
	 * @param classesNo
	 * 
	 * @return
	 */
	ClassesVo getClassesByNo(@Param("schoolId") Long schoolId,
							@Param("phaseId") Long phaseId,
							@Param("gradeId") Long gradeId,
							@Param("classesNo") Integer classesNo);
	
	/**
	 * 通过班级名称获取班级信息
	 * 
	 * @param schoolId
	 * @param classesName
	 * 
	 * @return
	 */
	ClassesVo getClassesByName(@Param("schoolId") Long schoolId,
							@Param("classesName") String classesName);
	
	
	/**
	 * 获取班级列表
	 * 
	 * @param schoolId
	 * 
	 * @return
	 */
	List<SysClasses> getSysClassesList(@Param("schoolId") Long schoolId);
	
	
	/**
	 * 获取班级列表
	 * 
	 * @param schoolId
	 * @param phaseId
	 * @param gradeId
	 * 
	 * @return
	 */
	List<ClassesVo> getClassesList(@Param("schoolId") Long schoolId,
			@Param("phaseId") Long phaseId, 
			@Param("gradeId") Long gradeId);
	
	/**
	 * 获取所班级列表（包括停用班级）
	 * 
	 * @param schoolId
	 * @param phaseId
	 * @param gradeId
	 * 
	 * @return
	 */
	List<ClassesVo> getAllClassesList(@Param("schoolId") Long schoolId,
			@Param("phaseId") Long phaseId, 
			@Param("gradeId") Long gradeId,
			@Param("isGraduated") Integer isGraduated);
	
	
	/**
	 * 班级查重
	 * 
	 * @param Long classesId
	 * @param Integer classesNo
	 * @Param Long schoolId,
	 * @Param Long phaseId,
	 * @Param Long gradeId
	 * 
	 * @return List<ClassesVo>
	 */
	
	List<ClassesVo> findClassesByClassesNo(@Param("classesId") Long classesId,
										@Param("classesNo") Integer classesNo,
										@Param("schoolId") Long schoolId,
										@Param("phaseId") Long phaseId, 
										@Param("gradeId") Long gradeId);
	
	
	/**
	 * 班级学科列表
	 * 
	 * @param phaseId
	 * @param classesId
	 * 
	 * @return List<ClassesSubjectVo>
	 */
	
	List<ClassesSubjectVo> getClassesSubjectList(@Param("phaseId") Long phaseId,@Param("classesId") Long classesId);
	
	/**
	 * 班级学科教师可选择列表
	 * 
	 * @param schoolId
	 * @param phaseId
	 * @param classesId
	 * @param subjectId
	 * @param userName
	 * @param selectids
	 * 
	 * @return List<ClassesTeacherVo>
	 */
	List<ClassesTeacherVo> getUnselectedTeacherList(@Param("schoolId") Long schoolId,
													@Param("phaseId") Long phaseId,
													@Param("classesId") Long classesId,
													@Param("subjectId") Long subjectId,
													@Param("userName") String userName,
													@Param("selectids") String selectids);
	
	
	/**
	 * 班级学科已任教教师列表
	 * 
	 * @param schoolId
	 * @param phaseId
	 * @param classesId
	 * @param subjectId
	 * 
	 * @return List<ClassesTeacherVo>
	 */
	List<ClassesTeacherVo> getSelectedTeacherList(@Param("schoolId") Long schoolId,
													@Param("phaseId") Long phaseId,
													@Param("classesId") Long classesId,
													@Param("subjectId") Long subjectId);

}
